#ifndef _IN_COM_TIMER_H_
#define _IN_COM_TIMER_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#include "InComDataTypeDef.h"
#include "InComPrint.h"

#define DEF_COM_SET_NEW_TIME    1
#define DEF_COM_NOT_SET_TIME    0

typedef struct
{
    Com_u32 now_time;
    Com_u32 last_time;
}SComSecondTimer,*pSComSecondTimer;

typedef struct
{
    Com_u64 now_time;
    Com_u64 last_time;
}SComMicroSecondsTimer,*pSComMicroSecondsTimer;

typedef struct
{
    Com_u32 year;
    Com_u32 mon;
    Com_u32 day;
    Com_u32 hour;
    Com_u32 min;
    Com_u32 sec;
}StComCurrentTime,*pStComCurrentTime;

typedef struct
{
    Com_u32 year;
    Com_u32 mon;
    Com_u32 day;
    Com_u32 hour;
    Com_u32 min;
    Com_u32 sec;
    Com_u32 week;
}SComDateWeek,*pSComDateWeek;

long int Ext_InComTimer_GetSysRunMs_TimeStamp(Com_void);
unsigned long int Ext_InComTimer_Date2TimeStamp(pStComCurrentTime dt,_P_OUT Com_s32 tz_sec);
Com_u32 Ext_InComTimer_TimeStamp2Date(Com_u32 timep,_P_OUT pStComCurrentTime date);
Com_s32 Ext_InComTimer_GetLocalTime(pStComCurrentTime cur_time);
Com_s32 Ext_InComTimer_GetTZLocalTime(pStComCurrentTime cur_time,Com_s32 tz);
Com_s32 Ext_InComTimer_GetDate(pSComDateWeek date);
Com_s32 Ext_InComTimer_GetTZDate(pSComDateWeek date,Com_s32 tz);
Com_u32 Ext_InComTimer_GetSysRunSec(Com_u8 set_time,pSComSecondTimer timer);
Com_u64 Ext_InComTimer_GetSysRunMs(Com_u8 set_time,pSComMicroSecondsTimer timer);
Com_void Ext_InComTimer_SetTZSec(Com_s32 val);
Com_s32 Ext_InComTimer_GetTZSec(Com_void);
Com_u32 Ext_InComTimer_GetWorldMs(Com_void);
Com_u32 Ext_InComTimer_GetWorldSec(Com_void);
Com_void Ext_InComTimer_GetTimeStr(Com_ps8 t_str);

#ifdef __cplusplus
}
#endif

#endif
